/**
 * Created by Baggio on 2018-4-25.
 */
$(function () {

});
function deleteNews(tid) {
    layer.confirm('是否删除？', {
        btn: ['是的','还是算了吧'] //按钮
    }, function(){
        var postData={newsId:tid};
        $.ajax({
            type: 'POST',
            url: '/admin/news/deleteNews.html',
            data:postData,
            dataType:'json',
            success: function(data){
                if (data.code != 1){
                    layer.msg('操作失败!',{icon : 5,time : 1000});
                    console.log(data.msg);
                    return;
                }
                layer.msg('操作成功!',{icon : 6,time : 1000},function(){
                    window.location.reload();
                })
            },
            error: function(XMLHttpRequest, textStatus, errorThrown){
                //alert(XMLHttpRequest.status);
                window.location.reload();
            }
        });

    }, function(){
        return;
    });

}